package com.olive.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import com.olive.entity.User;
import com.olive.service.impl.MybatisUserDetailsService;

@RestController
public class UserController {

	@Autowired
	private MybatisUserDetailsService mybatisUserDetailsService;

	@PostMapping("/create")
	public Map<String, Object> create(@RequestBody User user) {
		Map<String, Object> result = new HashMap<>();
		mybatisUserDetailsService.save(user);
		result.put("code", 200);
		result.put("message", "success");
		return result;
	}
}
